import os
import time
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp
import wsgiref.handlers

class MainPage(webapp.RequestHandler):
    def get(self):
        path = os.path.join(os.path.dirname(__file__), 'templates/index.html')
        self.response.out.write(template.render(path, {'now':time.ctime()}))


def main():
    application = webapp.WSGIApplication(
                                       [('/', MainPage)],
                                       debug=True)
    wsgiref.handlers.CGIHandler().run(application)

if __name__ == "__main__":
  main()